package com.itheima.shengxiao3;

import java.util.concurrent.ArrayBlockingQueue;

public class Cookie implements Runnable{

    private ArrayBlockingQueue<String> queue;

    public Cookie(ArrayBlockingQueue<String> queue) {
        this.queue = queue;
    }


    @Override
    public void run() {
        while (true) {
            try {

                Thread.sleep(50);
                queue.put("一份饭");
                System.out.println("厨子放了一份饭进去");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
